<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../includes/common.jsp" %>

<form id="form_edit" action="${scriptPath}" method="get">
	<input type="hidden" name="action" value="mark.edit" />
	<input type="hidden" name="me_id" value="${action.mark.id}"></input>
	
	<p><label>Họ đệm: 
		<input type="text" name="me_surname" 
		      value="${empty param.me_surname ? action.mark.studentSurname : param.me_surname}"></input></label> 
		<c:if test="${!(empty surnameErr)}">
			<span class="error-validating">${surnameErr}</span>
		</c:if>
	</p>

    <br />	
	<p><label>Tên: 
		<input type="text" name="me_name" 
		      value="${empty param.me_name ? action.mark.studentName : param.me_name}"></input></label> 
		<c:if test="${!(empty nameErr)}">
			<span class="error-validating">${nameErr}</span>
		</c:if>
	</p>
	<div class="error-validating">${action.studentNameError}</div>
	
    <br />  
	<p><label>MSSV: 
		<input type="text" name="me_sid" 
		      value="${empty param.me_sid ? action.mark.studentId : param.me_sid}"></input></label> 
		<c:if test="${!(empty sidErr)}">
			<span class="error-validating">${nameErr}</span>
		</c:if>
	</p>
	
    <br />  
	<p><label>Ngày sinh (d-m-YYYY): 
        <input type="text" name="me_sbirthday" 
                value="${empty param.me_sbirthday ? (empty action.mark.studentBirthday ? '' : u:formatDate(action.mark.studentBirthday)) : param.me_sbirthday}"></input></label> 
        
		<c:if test="${!(empty dateErr)}">
			<span style="">${dateErr}</span>
		</c:if>
	</p>
	<div class="error-validating">${action.studentBirthdayError}</div>
	
    <br />  
	<p><label>Phiên bản đề:
	   <select name="me_version" value="${param.me_version}">
	   <c:forEach items="${action.versions}" var="version">
	       <option value="${version.id}" ${version.id == param.me_version ? 'selected="selected"' : ''}>
	           ${version.id} - ${empty version.code ? '&lt;không tên&gt;' : version.code}
	       </option>
	   </c:forEach>
	   </select>
	</label>
	</p>
	<div class="error-validating">${action.versionError}</div>
	
    <br />  
	<p>
		<button type="submit" name="me_submit" value="save">Lưu</button>
		<button type="button" onclick="location.href='${scriptPath}?action=exam.view&ev_id=${exam.id}';">Quay về bài thi</button>
	</p>
</form>

<script type="text/javascript">
</script>